UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RytNlzPq6mgiLbStHApIibxU+zXfEYpIKrcxSL8DGyc='
WHERE
key_id = 'e1bf2e40a8b837e3158333edf28e405683cbf1cf11438d8cbbb8349ce39562e6'
AND (
token = 'RytNlzPq6mgiLbStHApIibxU+zXfEYpIKrcxSL8DGyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)