UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't8S1eAGBQ854Ag13cuq6+74utVUhli+4Jkd/ltmwKrs='
WHERE
key_id = 'e496c76afe33741c5ed0e5cad7c36a00d9b5b1ed7dc3a5452bbb599d628fe323'
AND (
token = 't8S1eAGBQ854Ag13cuq6+74utVUhli+4Jkd/ltmwKrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)