UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rDXapdQoLVAbTKGBD50mmYFq4AsQww4e+vpaHUwZH8s='
WHERE
key_id = 'e8b7c4bc0fd35174054557364488e4173b1b8fcd41bcf42c7d907f3f11062c82'
AND (
token = 'rDXapdQoLVAbTKGBD50mmYFq4AsQww4e+vpaHUwZH8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)