UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1kETyfYzCT0UY1vWIxeZyiseCfFaT+6cS90yqSDz04w=' 
WHERE 
  key_id = '271b4af2735cc82c013836c2b3e9aa30572561091f86711cdca93a8f696e706f' 
  AND (
    token = '1kETyfYzCT0UY1vWIxeZyiseCfFaT+6cS90yqSDz04w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028