UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EIMZY7spvAr/usAIhHlbV6wnA7RIV2Ams+pOkqAqy7A='
WHERE
key_id = 'd7b84230a67b69bf3d84cfb31c221f2e57ac95309abde23dc97707f4f0d5686d'
AND (
token = 'EIMZY7spvAr/usAIhHlbV6wnA7RIV2Ams+pOkqAqy7A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)