UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8a1rux65eBYO+7JsoUXj7gb7BTvIh8l2iRunSpyBVFs='
WHERE
key_id = '841235a127a1441a5f1aaf2b2fdef1ea1b02fc8464972dcd53d1f91c5fa07588'
AND (
token = '8a1rux65eBYO+7JsoUXj7gb7BTvIh8l2iRunSpyBVFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)