UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x5ElHkLoJqWE0LCjJZlWCCw3XBpANjCQxqtqkni0Vhs='
WHERE
key_id = '5128bcbd3e20888aa055c5c738cf51e73b7da7d78ac768539a56425c5c169ff5'
AND (
token = 'x5ElHkLoJqWE0LCjJZlWCCw3XBpANjCQxqtqkni0Vhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)