UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1GZmT52Td7eqYcn5P3UXvR2rQ1vuwniTst+LgmlbL/s=' 
WHERE 
  key_id = '51d0c8f952b30cc046095ddb75b35280e8dae6cbc59a3ca5ff001a695ff1659e' 
  AND (
    token = '1GZmT52Td7eqYcn5P3UXvR2rQ1vuwniTst+LgmlbL/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059