UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A6HWWBFJyuxZNsKOn42mqNIfVRKdrvZuCW8TIg9O1IA=' 
WHERE 
  key_id = '626a9b3a0a2b5d4b13d49e1ae831186c72667857e5630e084a2c421927851d14' 
  AND (
    token = 'A6HWWBFJyuxZNsKOn42mqNIfVRKdrvZuCW8TIg9O1IA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027