UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iSHcQXCvcP/HqB41MYALkJdmJAMfZ3wfn7Joup4wfyA=' 
WHERE 
  key_id = '68ba805907f14b71c28dab93ba5fcef7320f4323920224bc16c69bdf7597ea56' 
  AND (
    token = 'iSHcQXCvcP/HqB41MYALkJdmJAMfZ3wfn7Joup4wfyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016