UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Na2vjtvbZTJUVeeL9zgd42YqLfj2jhX7m6QqPxAeArE='
WHERE
key_id = '85fb2a1e15433777925809d040f4aa93821e393ddcab744008fed791bbe064e6'
AND (
token = 'Na2vjtvbZTJUVeeL9zgd42YqLfj2jhX7m6QqPxAeArE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)