UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wIplkajyJ9Zyc9Y3OIW6GDb+fMiwd82n2D4MEbjQhL0=' 
WHERE 
  key_id = 'ec2337bd308eee9890208f4246573159d4ad7ff8cbae79cc627a0bfb5a3b8ed3' 
  AND (
    token = 'wIplkajyJ9Zyc9Y3OIW6GDb+fMiwd82n2D4MEbjQhL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038