UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tU9piwPyR1RpfyIyM0I+QeKv3OLi5u+WvIMroOSflgM='
WHERE
key_id = '16ff2afa8a4462bd65d571880dc4aedb5334836d54dd39833bac877320f63267'
AND (
token = 'tU9piwPyR1RpfyIyM0I+QeKv3OLi5u+WvIMroOSflgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)