UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CkttaAtYpxpIKWRRKG860b1IC69O+MResaVlF2zVirY=' 
WHERE 
  key_id = '7ea824ad72abcca3836f639434437e15cbd597bb554a210dd2e216c877fad702' 
  AND (
    token = 'CkttaAtYpxpIKWRRKG860b1IC69O+MResaVlF2zVirY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028