UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '74aKH38+ALvW4JfsPs72vQ121XiDzfiSxzmjC2vbvDI=' 
WHERE 
  key_id = '55503957ec4f6819e28d933a3ddf417edad799bffc8c8dd353292a11ed4eefcb' 
  AND (
    token = '74aKH38+ALvW4JfsPs72vQ121XiDzfiSxzmjC2vbvDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032