UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eChbWlCPvMntRqXT7+kPMc36IB5Fa+VO/1gVmCIkefI=' 
WHERE 
  key_id = '8255d957255f28f4cab7a6def247d7e96a4477e06007afe13cbb1b1222dde72b' 
  AND (
    token = 'eChbWlCPvMntRqXT7+kPMc36IB5Fa+VO/1gVmCIkefI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036