UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WfgMb91Z89m93wXyiHn7h3kAMNTrfdJmROf4IVuYl2U=' 
WHERE 
  key_id = 'b2ff484ecb4e1f3a8b2c3d2d0580d85638216a9cd09e81002fb2db315d2857af' 
  AND (
    token = 'WfgMb91Z89m93wXyiHn7h3kAMNTrfdJmROf4IVuYl2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022