UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kHQo2Le/EAaKfMjGI+eI2+HcfwzBU90fhZziZIerQ7w='
WHERE
key_id = '29ce226cb8465fe9308cc81bce4dcc73b65db267bcf2443b81d485185da13037'
AND (
token = 'kHQo2Le/EAaKfMjGI+eI2+HcfwzBU90fhZziZIerQ7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)