UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lnwE6L+pv/TkN2KGl2j4KplDiWcbFO3DpaalrR+CzJg=' 
WHERE 
  key_id = '21aadaafafcd343d2daeb59ad3a98f35146dbd9295bb431cf386351b640e64d9' 
  AND (
    token = 'lnwE6L+pv/TkN2KGl2j4KplDiWcbFO3DpaalrR+CzJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020