UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xIFeRxVshawPPOlFMKU+Mm2GmqGNcWap1URqKtmErj8='
WHERE
key_id = '90fbddfc5207a8f30293acafba5aa3c36caad79221b74c80ae3cfc14f6a93e33'
AND (
token = 'xIFeRxVshawPPOlFMKU+Mm2GmqGNcWap1URqKtmErj8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)