UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '04AMyn+VFXPVEx3ZfCVWSOTlGnxcs646ly019g+bUL4=' 
WHERE 
  key_id = '23832b2b481c890f22b14ed9e25b463f6b6dd39d00888cdf60f070693937e8e0' 
  AND (
    token = '04AMyn+VFXPVEx3ZfCVWSOTlGnxcs646ly019g+bUL4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039