UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7GF0iitz4Pcr11baTzubE30nZpmEGGOwreSWJ0oOlz8=' 
WHERE 
  key_id = 'f33ceba468859b10c94e4c9e4d413b0d83298798a1bc27f2acbc8670728ed27e' 
  AND (
    token = '7GF0iitz4Pcr11baTzubE30nZpmEGGOwreSWJ0oOlz8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055