UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X3qArWCfkXGSuxT2SGaYyfajJpU/Ms1AVxbfG1Al3/M='
WHERE
key_id = '7ed7a646533afd88ee783cf261eeb9babc6abb11b9cb6da686c4825b1ec65791'
AND (
token = 'X3qArWCfkXGSuxT2SGaYyfajJpU/Ms1AVxbfG1Al3/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)