UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qXBRFPkzr5mteG520Ta01dSa7bTQLgq3v+F+ArOwWCg=' 
WHERE 
  key_id = '1c432a4d0783c74b28d661ffb577dfdb0da39808372a20047e79c2e205a3257f' 
  AND (
    token = 'qXBRFPkzr5mteG520Ta01dSa7bTQLgq3v+F+ArOwWCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036