UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uqQIJbGywbtkwgb9NWHdJOEGceqTbIgbd1OlmtgjMac='
WHERE
key_id = '8da7c75d73135640628320a21a0f52823cab4c7d5a175920c05ac688a527e8e0'
AND (
token = 'uqQIJbGywbtkwgb9NWHdJOEGceqTbIgbd1OlmtgjMac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)