UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lZqjYIyors9wwMa6L91WtjAXr2U/iQEpHmgEq4115LQ=' 
WHERE 
  key_id = 'f8ccf04142ac891d1e6f4052b7db42bf93e7bc6d98b67c2eafa4587174de84b3' 
  AND (
    token = 'lZqjYIyors9wwMa6L91WtjAXr2U/iQEpHmgEq4115LQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052