UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VfQiSGUNhk6iw5Gg2B+WbEhYAqVnMB2shHmqaKamUfU='
WHERE
key_id = '2ca1f88b99c89a5a37498af1afd87579a73bbf13a28c2f18c66273d96874f684'
AND (
token = 'VfQiSGUNhk6iw5Gg2B+WbEhYAqVnMB2shHmqaKamUfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)