UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ob2708jaaw6nx2SFjhjcbKOvqsh45r0Fre7vd57maQ=' 
WHERE 
  key_id = 'b5e3b7ac4e18f5803569e001b4e73270fb3a42b9b1173ac7291ea815bac0c9ed' 
  AND (
    token = '9ob2708jaaw6nx2SFjhjcbKOvqsh45r0Fre7vd57maQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025