UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ed5F3KYF8Yd2+oE2gDhPBFJ0lAFdmFiOVs9165pAhMc='
WHERE
key_id = 'f11f94870dd10f1ae5b4b713e486c1f0e9ba005b4df70f7a9ca822fb649064fc'
AND (
token = 'Ed5F3KYF8Yd2+oE2gDhPBFJ0lAFdmFiOVs9165pAhMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)