UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'En6dOiZLFmTK9R0V+FuTZccU10uqSRFAB4YPSYvfqnw=' 
WHERE 
  key_id = '6afa2767cdbb815698bd99a961356ae245ff3ec1ddc8474f7a013abef24f7b81' 
  AND (
    token = 'En6dOiZLFmTK9R0V+FuTZccU10uqSRFAB4YPSYvfqnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014