UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2rpvvHSf1oaxrvwwvAz6InUTV83iYaFZz8u2ox088B4=' 
WHERE 
  key_id = '81cb6242ffe128f7a4988e2ae70a8ad6cd7efcf5a6a876b04fbc05e7e9b8e9e6' 
  AND (
    token = '2rpvvHSf1oaxrvwwvAz6InUTV83iYaFZz8u2ox088B4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030