UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fqtj4DsqfRfD0j41qbJ25C7y8dskBD/dOQcxSuHltDg='
WHERE
key_id = '61ae0f98ec8b042389ae043e8179cb3e5526504fa564f6edab001df281cc12fa'
AND (
token = 'fqtj4DsqfRfD0j41qbJ25C7y8dskBD/dOQcxSuHltDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)