UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Md33HGATE4PMgsqQteznAdXaHfQPs5kcq1+DhnwJLQQ='
WHERE
key_id = '49d196de2e183243b5f9d9cecfed792cd8a2e3197ab1aa36ea9cbc6a9d2bf192'
AND (
token = 'Md33HGATE4PMgsqQteznAdXaHfQPs5kcq1+DhnwJLQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)