UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wg1nSjqzsTuMgu7jedd1WTkdsK8BTkzuuG0Pygt7JdU='
WHERE
key_id = '912ce2e7d35ae387c7fcad10c289e1d848efe4a46ecdfb5dc740d825e3b99f46'
AND (
token = 'Wg1nSjqzsTuMgu7jedd1WTkdsK8BTkzuuG0Pygt7JdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)