UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LE2qv9ycP608JVBOyEoUFybWJ3YB4BPFJU+tOEIpJW8=' 
WHERE 
  key_id = '951e699db51b0518eee1d278d740b15b9f793d9c38c7f276f128fd6277eb4e8a' 
  AND (
    token = 'LE2qv9ycP608JVBOyEoUFybWJ3YB4BPFJU+tOEIpJW8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040