UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k3wfkhoLw7wqG/7XsF+lrEq7YnV6Sh/EjVIdzeWPRQE='
WHERE
key_id = '956b3eff7adb4e39cec970201707b30e68b05344d6c0a3f1c7752acce2de1b8c'
AND (
token = 'k3wfkhoLw7wqG/7XsF+lrEq7YnV6Sh/EjVIdzeWPRQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)