UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OSLuXh2kzr4J3UVK3FhMGQMEy6FmRXe6ST+JC2y9S9M=' 
WHERE 
  key_id = 'e12be0204a31dea235fa393d90dafb2c1f6d7d115d93b9dbd4d035f4da03bc04' 
  AND (
    token = 'OSLuXh2kzr4J3UVK3FhMGQMEy6FmRXe6ST+JC2y9S9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039