UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ktvv9GiALzNoJ47KoilgbtoSjnI8PJI3Yb4tKNRET54=' 
WHERE 
  key_id = '8ceb05a115f0b372b03695d69d569899e31d4f032f75162e356faf80c9422dc2' 
  AND (
    token = 'ktvv9GiALzNoJ47KoilgbtoSjnI8PJI3Yb4tKNRET54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024