UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+C9k1DKBOzeP/mp47yXa0zU+FGqOjyDy0kyliOIol2E='
WHERE
key_id = 'db37b8cf0e188de828b3faf25fbd90a4f4a3277724a630afa3424f9f876f028b'
AND (
token = '+C9k1DKBOzeP/mp47yXa0zU+FGqOjyDy0kyliOIol2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)