UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K2FUPk+mWPd1cIchNPkixn+qWh4ugU7XKoT6E+vWD0U='
WHERE
key_id = 'f5d3bacdf5ad4bd2c4c20ba4b1bd4c5a605c6b8be377d9710515274432c6317c'
AND (
token = 'K2FUPk+mWPd1cIchNPkixn+qWh4ugU7XKoT6E+vWD0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)