UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mTzp8fe49gTZB+D8ClyVRQfl3WH8wV8oYQ8P27pZsD8='
WHERE
key_id = '6ffa405490d278b219b5ca48217dd621b4d70261fd2dfdaee7dc45888c7e5a6a'
AND (
token = 'mTzp8fe49gTZB+D8ClyVRQfl3WH8wV8oYQ8P27pZsD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)