UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6SEOxLaAsDz2aqgxs8vdGEFHG3Ngg2N+dknNjLGKx5Q='
WHERE
key_id = 'e647d4757ce5cce1cf7a9dedbaf6c58db3a54447d7d6ae1e835ad98e23d50ed6'
AND (
token = '6SEOxLaAsDz2aqgxs8vdGEFHG3Ngg2N+dknNjLGKx5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)