UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cgQRGk09HUHvB7APMthrode2FotBmp76GQrlDctb+rY='
WHERE
key_id = '73bf20c1426ea3b0bcebf1314fd7c5ba6d7cbb3e7d1ecb52d7a07e87cb528423'
AND (
token = 'cgQRGk09HUHvB7APMthrode2FotBmp76GQrlDctb+rY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)