UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'adSVGSaEGbNCltwbWRMenQ9LB3qkXIyT2T1QV9wlXX4='
WHERE
key_id = '7ded7f68ddd29c2a195d4a7f65621b8e197f65d4c82050927aadb454191738b8'
AND (
token = 'adSVGSaEGbNCltwbWRMenQ9LB3qkXIyT2T1QV9wlXX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)