UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W1gFANJvZzNOaulXbo7hAoK+Yw5dyH0zrsQkZc80K1Q='
WHERE
key_id = '4b6e1af60467c235ca062ecfa092f72f329440d229f1026aabeeaccc6bd692c2'
AND (
token = 'W1gFANJvZzNOaulXbo7hAoK+Yw5dyH0zrsQkZc80K1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)