UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zd869kUxJQukcz9uuiv9cwYw9GV9cBc+mVFrgVZd7nA='
WHERE
key_id = 'aaab980a5763c202ad1d87be19027200ddf06840a4a2c5493003b4dab275e955'
AND (
token = 'zd869kUxJQukcz9uuiv9cwYw9GV9cBc+mVFrgVZd7nA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)