UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UVOk2eMJCpWmSLS9hL+YKXijQg+vLOpwbfhMVxniHPE='
WHERE
key_id = '9dae61206dddd4b8b4ff50922db96319fa9c4a11c0bd79e1b1b97b70eb38c4ce'
AND (
token = 'UVOk2eMJCpWmSLS9hL+YKXijQg+vLOpwbfhMVxniHPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)